\(\int x^2 (a+b \log (c (d+e x)^n)) (f+g \log (c (d+e x)^n)) \, dx\) [379]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 32, antiderivative size = 258 \[ \int x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {2 b d^2 g n^2 x}{e^2}-\frac {b d g n^2 (d+e x)^2}{2 e^3}+\frac {2 b g n^2 (d+e x)^3}{27 e^3}-\frac {b d^3 g n^2 \log ^2(d+e x)}{3 e^3}+\frac {1}{3} x^3 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )-\frac {d^2 n (d+e x) \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{e^3}+\frac {d n (d+e x)^2 \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{2 e^3}-\frac {n (d+e x)^3 \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{9 e^3}+\frac {d^3 n \log (d+e x) \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{3 e^3} \]

[Out]

2*b*d^2*g*n^2*x/e^2-1/2*b*d*g*n^2*(e*x+d)^2/e^3+2/27*b*g*n^2*(e*x+d)^3/e^3-1/3*b*d^3*g*n^2*ln(e*x+d)^2/e^3+1/3
*x^3*(a+b*ln(c*(e*x+d)^n))*(f+g*ln(c*(e*x+d)^n))-d^2*n*(e*x+d)*(b*f+a*g+2*b*g*ln(c*(e*x+d)^n))/e^3+1/2*d*n*(e*
x+d)^2*(b*f+a*g+2*b*g*ln(c*(e*x+d)^n))/e^3-1/9*n*(e*x+d)^3*(b*f+a*g+2*b*g*ln(c*(e*x+d)^n))/e^3+1/3*d^3*n*ln(e*
x+d)*(b*f+a*g+2*b*g*ln(c*(e*x+d)^n))/e^3

Rubi [A] (verified)

Time = 0.21 (sec) , antiderivative size = 258, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.219, Rules used = {2483, 2458, 45, 2372, 12, 14, 2338} \[ \int x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {d^3 n \log (d+e x) \left (a g+2 b g \log \left (c (d+e x)^n\right )+b f\right )}{3 e^3}-\frac {d^2 n (d+e x) \left (a g+2 b g \log \left (c (d+e x)^n\right )+b f\right )}{e^3}+\frac {d n (d+e x)^2 \left (a g+2 b g \log \left (c (d+e x)^n\right )+b f\right )}{2 e^3}-\frac {n (d+e x)^3 \left (a g+2 b g \log \left (c (d+e x)^n\right )+b f\right )}{9 e^3}+\frac {1}{3} x^3 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (g \log \left (c (d+e x)^n\right )+f\right )-\frac {b d^3 g n^2 \log ^2(d+e x)}{3 e^3}+\frac {2 b d^2 g n^2 x}{e^2}-\frac {b d g n^2 (d+e x)^2}{2 e^3}+\frac {2 b g n^2 (d+e x)^3}{27 e^3} \]

[In]

Int[x^2*(a + b*Log[c*(d + e*x)^n])*(f + g*Log[c*(d + e*x)^n]),x]

[Out]

(2*b*d^2*g*n^2*x)/e^2 - (b*d*g*n^2*(d + e*x)^2)/(2*e^3) + (2*b*g*n^2*(d + e*x)^3)/(27*e^3) - (b*d^3*g*n^2*Log[
d + e*x]^2)/(3*e^3) + (x^3*(a + b*Log[c*(d + e*x)^n])*(f + g*Log[c*(d + e*x)^n]))/3 - (d^2*n*(d + e*x)*(b*f +
a*g + 2*b*g*Log[c*(d + e*x)^n]))/e^3 + (d*n*(d + e*x)^2*(b*f + a*g + 2*b*g*Log[c*(d + e*x)^n]))/(2*e^3) - (n*(
d + e*x)^3*(b*f + a*g + 2*b*g*Log[c*(d + e*x)^n]))/(9*e^3) + (d^3*n*Log[d + e*x]*(b*f + a*g + 2*b*g*Log[c*(d +
 e*x)^n]))/(3*e^3)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 2338

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))/(x_), x_Symbol] :> Simp[(a + b*Log[c*x^n])^2/(2*b*n), x] /; FreeQ[{a
, b, c, n}, x]

Rule 2372

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*(x_)^(m_.)*((d_) + (e_.)*(x_)^(r_.))^(q_.), x_Symbol] :> With[{u = I
ntHide[x^m*(d + e*x^r)^q, x]}, Dist[a + b*Log[c*x^n], u, x] - Dist[b*n, Int[SimplifyIntegrand[u/x, x], x], x]]
 /; FreeQ[{a, b, c, d, e, n, r}, x] && IGtQ[q, 0] && IntegerQ[m] &&  !(EqQ[q, 1] && EqQ[m, -1])

Rule 2458

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.)*((f_.) + (g_.)*(x_))^(q_.)*((h_.) + (i_.)*(x_))
^(r_.), x_Symbol] :> Dist[1/e, Subst[Int[(g*(x/e))^q*((e*h - d*i)/e + i*(x/e))^r*(a + b*Log[c*x^n])^p, x], x,
d + e*x], x] /; FreeQ[{a, b, c, d, e, f, g, h, i, n, p, q, r}, x] && EqQ[e*f - d*g, 0] && (IGtQ[p, 0] || IGtQ[
r, 0]) && IntegerQ[2*r]

Rule 2483

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(g_.))*
(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)*(a + b*Log[c*(d + e*x)^n])*((f + g*Log[c*(d + e*x)^n])/(m + 1)), x] -
Dist[e*(n/(m + 1)), Int[(x^(m + 1)*(b*f + a*g + 2*b*g*Log[c*(d + e*x)^n]))/(d + e*x), x], x] /; FreeQ[{a, b, c
, d, e, f, g, n, m}, x] && NeQ[m, -1]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{3} x^3 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )-\frac {1}{3} (e n) \int \frac {x^3 \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{d+e x} \, dx \\ & = \frac {1}{3} x^3 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )-\frac {1}{3} n \text {Subst}\left (\int \frac {\left (-\frac {d}{e}+\frac {x}{e}\right )^3 \left (b f+a g+2 b g \log \left (c x^n\right )\right )}{x} \, dx,x,d+e x\right ) \\ & = \frac {1}{3} x^3 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )-\frac {d^2 n (d+e x) \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{e^3}+\frac {d n (d+e x)^2 \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{2 e^3}-\frac {n (d+e x)^3 \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{9 e^3}+\frac {d^3 n \log (d+e x) \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{3 e^3}+\frac {1}{3} \left (2 b g n^2\right ) \text {Subst}\left (\int \frac {18 d^2 x-9 d x^2+2 x^3-6 d^3 \log (x)}{6 e^3 x} \, dx,x,d+e x\right ) \\ & = \frac {1}{3} x^3 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )-\frac {d^2 n (d+e x) \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{e^3}+\frac {d n (d+e x)^2 \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{2 e^3}-\frac {n (d+e x)^3 \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{9 e^3}+\frac {d^3 n \log (d+e x) \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{3 e^3}+\frac {\left (b g n^2\right ) \text {Subst}\left (\int \frac {18 d^2 x-9 d x^2+2 x^3-6 d^3 \log (x)}{x} \, dx,x,d+e x\right )}{9 e^3} \\ & = \frac {1}{3} x^3 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )-\frac {d^2 n (d+e x) \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{e^3}+\frac {d n (d+e x)^2 \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{2 e^3}-\frac {n (d+e x)^3 \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{9 e^3}+\frac {d^3 n \log (d+e x) \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{3 e^3}+\frac {\left (b g n^2\right ) \text {Subst}\left (\int \left (18 d^2-9 d x+2 x^2-\frac {6 d^3 \log (x)}{x}\right ) \, dx,x,d+e x\right )}{9 e^3} \\ & = \frac {2 b d^2 g n^2 x}{e^2}-\frac {b d g n^2 (d+e x)^2}{2 e^3}+\frac {2 b g n^2 (d+e x)^3}{27 e^3}+\frac {1}{3} x^3 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )-\frac {d^2 n (d+e x) \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{e^3}+\frac {d n (d+e x)^2 \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{2 e^3}-\frac {n (d+e x)^3 \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{9 e^3}+\frac {d^3 n \log (d+e x) \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{3 e^3}-\frac {\left (2 b d^3 g n^2\right ) \text {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,d+e x\right )}{3 e^3} \\ & = \frac {2 b d^2 g n^2 x}{e^2}-\frac {b d g n^2 (d+e x)^2}{2 e^3}+\frac {2 b g n^2 (d+e x)^3}{27 e^3}-\frac {b d^3 g n^2 \log ^2(d+e x)}{3 e^3}+\frac {1}{3} x^3 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right )-\frac {d^2 n (d+e x) \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{e^3}+\frac {d n (d+e x)^2 \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{2 e^3}-\frac {n (d+e x)^3 \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{9 e^3}+\frac {d^3 n \log (d+e x) \left (b f+a g+2 b g \log \left (c (d+e x)^n\right )\right )}{3 e^3} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.13 (sec) , antiderivative size = 205, normalized size of antiderivative = 0.79 \[ \int x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {e x \left (3 a \left (-6 d^2 g n+3 d e g n x+2 e^2 (3 f-g n) x^2\right )+b n \left (d^2 (-18 f+66 g n)+3 d e (3 f-5 g n) x+2 e^2 (-3 f+2 g n) x^2\right )\right )+18 d^3 (b f+a g) n \log (d+e x)-6 \left (-3 a e^3 g x^3+b \left (11 d^3 g n+6 d^2 e g n x-3 d e^2 g n x^2+e^3 (-3 f+2 g n) x^3\right )\right ) \log \left (c (d+e x)^n\right )+18 b g \left (d^3+e^3 x^3\right ) \log ^2\left (c (d+e x)^n\right )}{54 e^3} \]

[In]

Integrate[x^2*(a + b*Log[c*(d + e*x)^n])*(f + g*Log[c*(d + e*x)^n]),x]

[Out]

(e*x*(3*a*(-6*d^2*g*n + 3*d*e*g*n*x + 2*e^2*(3*f - g*n)*x^2) + b*n*(d^2*(-18*f + 66*g*n) + 3*d*e*(3*f - 5*g*n)
*x + 2*e^2*(-3*f + 2*g*n)*x^2)) + 18*d^3*(b*f + a*g)*n*Log[d + e*x] - 6*(-3*a*e^3*g*x^3 + b*(11*d^3*g*n + 6*d^
2*e*g*n*x - 3*d*e^2*g*n*x^2 + e^3*(-3*f + 2*g*n)*x^3))*Log[c*(d + e*x)^n] + 18*b*g*(d^3 + e^3*x^3)*Log[c*(d +
e*x)^n]^2)/(54*e^3)

Maple [A] (verified)

Time = 0.66 (sec) , antiderivative size = 354, normalized size of antiderivative = 1.37

method result size
parallelrisch \(\frac {18 a \,e^{3} f \,x^{3}-66 b \,d^{3} g \,n^{2}-12 x^{3} \ln \left (c \left (e x +d \right )^{n}\right ) b \,e^{3} g n -102 \ln \left (e x +d \right ) b \,d^{3} g \,n^{2}+18 \ln \left (e x +d \right ) a \,d^{3} g n +18 \ln \left (e x +d \right ) b \,d^{3} f n -15 b d \,e^{2} g \,n^{2} x^{2}+66 b \,d^{2} e g \,n^{2} x +18 a \,d^{3} g n +18 b \,d^{3} f n +4 b \,e^{3} g \,n^{2} x^{3}-6 n a \,e^{3} g \,x^{3}-6 n b \,e^{3} f \,x^{3}-36 x \ln \left (c \left (e x +d \right )^{n}\right ) b \,d^{2} e g n +18 x^{2} \ln \left (c \left (e x +d \right )^{n}\right ) b d \,e^{2} g n +18 x^{3} \ln \left (c \left (e x +d \right )^{n}\right )^{2} b \,e^{3} g +18 x^{3} \ln \left (c \left (e x +d \right )^{n}\right ) a \,e^{3} g +18 x^{3} \ln \left (c \left (e x +d \right )^{n}\right ) b \,e^{3} f +36 \ln \left (c \left (e x +d \right )^{n}\right ) b \,d^{3} g n +18 \ln \left (c \left (e x +d \right )^{n}\right )^{2} b \,d^{3} g -18 a \,d^{2} e g n x -18 b \,d^{2} e f n x +9 a d \,e^{2} g n \,x^{2}+9 b d \,e^{2} f n \,x^{2}}{54 e^{3}}\) \(354\)
risch \(\text {Expression too large to display}\) \(1785\)

[In]

int(x^2*(a+b*ln(c*(e*x+d)^n))*(f+g*ln(c*(e*x+d)^n)),x,method=_RETURNVERBOSE)

[Out]

1/54*(18*a*e^3*f*x^3-66*b*d^3*g*n^2-12*x^3*ln(c*(e*x+d)^n)*b*e^3*g*n-102*ln(e*x+d)*b*d^3*g*n^2+18*ln(e*x+d)*a*
d^3*g*n+18*ln(e*x+d)*b*d^3*f*n-15*b*d*e^2*g*n^2*x^2+66*b*d^2*e*g*n^2*x+18*a*d^3*g*n+18*b*d^3*f*n+4*b*e^3*g*n^2
*x^3-6*n*a*e^3*g*x^3-6*n*b*e^3*f*x^3-36*x*ln(c*(e*x+d)^n)*b*d^2*e*g*n+18*x^2*ln(c*(e*x+d)^n)*b*d*e^2*g*n+18*x^
3*ln(c*(e*x+d)^n)^2*b*e^3*g+18*x^3*ln(c*(e*x+d)^n)*a*e^3*g+18*x^3*ln(c*(e*x+d)^n)*b*e^3*f+36*ln(c*(e*x+d)^n)*b
*d^3*g*n+18*ln(c*(e*x+d)^n)^2*b*d^3*g-18*a*d^2*e*g*n*x-18*b*d^2*e*f*n*x+9*a*d*e^2*g*n*x^2+9*b*d*e^2*f*n*x^2)/e
^3

Fricas [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 329, normalized size of antiderivative = 1.28 \[ \int x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {18 \, b e^{3} g x^{3} \log \left (c\right )^{2} + 2 \, {\left (2 \, b e^{3} g n^{2} + 9 \, a e^{3} f - 3 \, {\left (b e^{3} f + a e^{3} g\right )} n\right )} x^{3} - 3 \, {\left (5 \, b d e^{2} g n^{2} - 3 \, {\left (b d e^{2} f + a d e^{2} g\right )} n\right )} x^{2} + 18 \, {\left (b e^{3} g n^{2} x^{3} + b d^{3} g n^{2}\right )} \log \left (e x + d\right )^{2} + 6 \, {\left (11 \, b d^{2} e g n^{2} - 3 \, {\left (b d^{2} e f + a d^{2} e g\right )} n\right )} x + 6 \, {\left (3 \, b d e^{2} g n^{2} x^{2} - 6 \, b d^{2} e g n^{2} x - 11 \, b d^{3} g n^{2} - {\left (2 \, b e^{3} g n^{2} - 3 \, {\left (b e^{3} f + a e^{3} g\right )} n\right )} x^{3} + 3 \, {\left (b d^{3} f + a d^{3} g\right )} n + 6 \, {\left (b e^{3} g n x^{3} + b d^{3} g n\right )} \log \left (c\right )\right )} \log \left (e x + d\right ) + 6 \, {\left (3 \, b d e^{2} g n x^{2} - 6 \, b d^{2} e g n x - {\left (2 \, b e^{3} g n - 3 \, b e^{3} f - 3 \, a e^{3} g\right )} x^{3}\right )} \log \left (c\right )}{54 \, e^{3}} \]

[In]

integrate(x^2*(a+b*log(c*(e*x+d)^n))*(f+g*log(c*(e*x+d)^n)),x, algorithm="fricas")

[Out]

1/54*(18*b*e^3*g*x^3*log(c)^2 + 2*(2*b*e^3*g*n^2 + 9*a*e^3*f - 3*(b*e^3*f + a*e^3*g)*n)*x^3 - 3*(5*b*d*e^2*g*n
^2 - 3*(b*d*e^2*f + a*d*e^2*g)*n)*x^2 + 18*(b*e^3*g*n^2*x^3 + b*d^3*g*n^2)*log(e*x + d)^2 + 6*(11*b*d^2*e*g*n^
2 - 3*(b*d^2*e*f + a*d^2*e*g)*n)*x + 6*(3*b*d*e^2*g*n^2*x^2 - 6*b*d^2*e*g*n^2*x - 11*b*d^3*g*n^2 - (2*b*e^3*g*
n^2 - 3*(b*e^3*f + a*e^3*g)*n)*x^3 + 3*(b*d^3*f + a*d^3*g)*n + 6*(b*e^3*g*n*x^3 + b*d^3*g*n)*log(c))*log(e*x +
 d) + 6*(3*b*d*e^2*g*n*x^2 - 6*b*d^2*e*g*n*x - (2*b*e^3*g*n - 3*b*e^3*f - 3*a*e^3*g)*x^3)*log(c))/e^3

Sympy [A] (verification not implemented)

Time = 1.17 (sec) , antiderivative size = 384, normalized size of antiderivative = 1.49 \[ \int x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx=\begin {cases} \frac {a d^{3} g \log {\left (c \left (d + e x\right )^{n} \right )}}{3 e^{3}} - \frac {a d^{2} g n x}{3 e^{2}} + \frac {a d g n x^{2}}{6 e} + \frac {a f x^{3}}{3} - \frac {a g n x^{3}}{9} + \frac {a g x^{3} \log {\left (c \left (d + e x\right )^{n} \right )}}{3} + \frac {b d^{3} f \log {\left (c \left (d + e x\right )^{n} \right )}}{3 e^{3}} - \frac {11 b d^{3} g n \log {\left (c \left (d + e x\right )^{n} \right )}}{9 e^{3}} + \frac {b d^{3} g \log {\left (c \left (d + e x\right )^{n} \right )}^{2}}{3 e^{3}} - \frac {b d^{2} f n x}{3 e^{2}} + \frac {11 b d^{2} g n^{2} x}{9 e^{2}} - \frac {2 b d^{2} g n x \log {\left (c \left (d + e x\right )^{n} \right )}}{3 e^{2}} + \frac {b d f n x^{2}}{6 e} - \frac {5 b d g n^{2} x^{2}}{18 e} + \frac {b d g n x^{2} \log {\left (c \left (d + e x\right )^{n} \right )}}{3 e} - \frac {b f n x^{3}}{9} + \frac {b f x^{3} \log {\left (c \left (d + e x\right )^{n} \right )}}{3} + \frac {2 b g n^{2} x^{3}}{27} - \frac {2 b g n x^{3} \log {\left (c \left (d + e x\right )^{n} \right )}}{9} + \frac {b g x^{3} \log {\left (c \left (d + e x\right )^{n} \right )}^{2}}{3} & \text {for}\: e \neq 0 \\\frac {x^{3} \left (a + b \log {\left (c d^{n} \right )}\right ) \left (f + g \log {\left (c d^{n} \right )}\right )}{3} & \text {otherwise} \end {cases} \]

[In]

integrate(x**2*(a+b*ln(c*(e*x+d)**n))*(f+g*ln(c*(e*x+d)**n)),x)

[Out]

Piecewise((a*d**3*g*log(c*(d + e*x)**n)/(3*e**3) - a*d**2*g*n*x/(3*e**2) + a*d*g*n*x**2/(6*e) + a*f*x**3/3 - a
*g*n*x**3/9 + a*g*x**3*log(c*(d + e*x)**n)/3 + b*d**3*f*log(c*(d + e*x)**n)/(3*e**3) - 11*b*d**3*g*n*log(c*(d
+ e*x)**n)/(9*e**3) + b*d**3*g*log(c*(d + e*x)**n)**2/(3*e**3) - b*d**2*f*n*x/(3*e**2) + 11*b*d**2*g*n**2*x/(9
*e**2) - 2*b*d**2*g*n*x*log(c*(d + e*x)**n)/(3*e**2) + b*d*f*n*x**2/(6*e) - 5*b*d*g*n**2*x**2/(18*e) + b*d*g*n
*x**2*log(c*(d + e*x)**n)/(3*e) - b*f*n*x**3/9 + b*f*x**3*log(c*(d + e*x)**n)/3 + 2*b*g*n**2*x**3/27 - 2*b*g*n
*x**3*log(c*(d + e*x)**n)/9 + b*g*x**3*log(c*(d + e*x)**n)**2/3, Ne(e, 0)), (x**3*(a + b*log(c*d**n))*(f + g*l
og(c*d**n))/3, True))

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 274, normalized size of antiderivative = 1.06 \[ \int x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {1}{3} \, b g x^{3} \log \left ({\left (e x + d\right )}^{n} c\right )^{2} + \frac {1}{3} \, b f x^{3} \log \left ({\left (e x + d\right )}^{n} c\right ) + \frac {1}{3} \, a g x^{3} \log \left ({\left (e x + d\right )}^{n} c\right ) + \frac {1}{3} \, a f x^{3} + \frac {1}{18} \, b e f n {\left (\frac {6 \, d^{3} \log \left (e x + d\right )}{e^{4}} - \frac {2 \, e^{2} x^{3} - 3 \, d e x^{2} + 6 \, d^{2} x}{e^{3}}\right )} + \frac {1}{18} \, a e g n {\left (\frac {6 \, d^{3} \log \left (e x + d\right )}{e^{4}} - \frac {2 \, e^{2} x^{3} - 3 \, d e x^{2} + 6 \, d^{2} x}{e^{3}}\right )} + \frac {1}{54} \, {\left (6 \, e n {\left (\frac {6 \, d^{3} \log \left (e x + d\right )}{e^{4}} - \frac {2 \, e^{2} x^{3} - 3 \, d e x^{2} + 6 \, d^{2} x}{e^{3}}\right )} \log \left ({\left (e x + d\right )}^{n} c\right ) + \frac {{\left (4 \, e^{3} x^{3} - 15 \, d e^{2} x^{2} - 18 \, d^{3} \log \left (e x + d\right )^{2} + 66 \, d^{2} e x - 66 \, d^{3} \log \left (e x + d\right )\right )} n^{2}}{e^{3}}\right )} b g \]

[In]

integrate(x^2*(a+b*log(c*(e*x+d)^n))*(f+g*log(c*(e*x+d)^n)),x, algorithm="maxima")

[Out]

1/3*b*g*x^3*log((e*x + d)^n*c)^2 + 1/3*b*f*x^3*log((e*x + d)^n*c) + 1/3*a*g*x^3*log((e*x + d)^n*c) + 1/3*a*f*x
^3 + 1/18*b*e*f*n*(6*d^3*log(e*x + d)/e^4 - (2*e^2*x^3 - 3*d*e*x^2 + 6*d^2*x)/e^3) + 1/18*a*e*g*n*(6*d^3*log(e
*x + d)/e^4 - (2*e^2*x^3 - 3*d*e*x^2 + 6*d^2*x)/e^3) + 1/54*(6*e*n*(6*d^3*log(e*x + d)/e^4 - (2*e^2*x^3 - 3*d*
e*x^2 + 6*d^2*x)/e^3)*log((e*x + d)^n*c) + (4*e^3*x^3 - 15*d*e^2*x^2 - 18*d^3*log(e*x + d)^2 + 66*d^2*e*x - 66
*d^3*log(e*x + d))*n^2/e^3)*b*g

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 741 vs. \(2 (244) = 488\).

Time = 0.31 (sec) , antiderivative size = 741, normalized size of antiderivative = 2.87 \[ \int x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx=\frac {{\left (e x + d\right )}^{3} b g n^{2} \log \left (e x + d\right )^{2}}{3 \, e^{3}} - \frac {{\left (e x + d\right )}^{2} b d g n^{2} \log \left (e x + d\right )^{2}}{e^{3}} + \frac {{\left (e x + d\right )} b d^{2} g n^{2} \log \left (e x + d\right )^{2}}{e^{3}} - \frac {2 \, {\left (e x + d\right )}^{3} b g n^{2} \log \left (e x + d\right )}{9 \, e^{3}} + \frac {{\left (e x + d\right )}^{2} b d g n^{2} \log \left (e x + d\right )}{e^{3}} - \frac {2 \, {\left (e x + d\right )} b d^{2} g n^{2} \log \left (e x + d\right )}{e^{3}} + \frac {2 \, {\left (e x + d\right )}^{3} b g n \log \left (e x + d\right ) \log \left (c\right )}{3 \, e^{3}} - \frac {2 \, {\left (e x + d\right )}^{2} b d g n \log \left (e x + d\right ) \log \left (c\right )}{e^{3}} + \frac {2 \, {\left (e x + d\right )} b d^{2} g n \log \left (e x + d\right ) \log \left (c\right )}{e^{3}} + \frac {2 \, {\left (e x + d\right )}^{3} b g n^{2}}{27 \, e^{3}} - \frac {{\left (e x + d\right )}^{2} b d g n^{2}}{2 \, e^{3}} + \frac {2 \, {\left (e x + d\right )} b d^{2} g n^{2}}{e^{3}} + \frac {{\left (e x + d\right )}^{3} b f n \log \left (e x + d\right )}{3 \, e^{3}} - \frac {{\left (e x + d\right )}^{2} b d f n \log \left (e x + d\right )}{e^{3}} + \frac {{\left (e x + d\right )} b d^{2} f n \log \left (e x + d\right )}{e^{3}} + \frac {{\left (e x + d\right )}^{3} a g n \log \left (e x + d\right )}{3 \, e^{3}} - \frac {{\left (e x + d\right )}^{2} a d g n \log \left (e x + d\right )}{e^{3}} + \frac {{\left (e x + d\right )} a d^{2} g n \log \left (e x + d\right )}{e^{3}} - \frac {2 \, {\left (e x + d\right )}^{3} b g n \log \left (c\right )}{9 \, e^{3}} + \frac {{\left (e x + d\right )}^{2} b d g n \log \left (c\right )}{e^{3}} - \frac {2 \, {\left (e x + d\right )} b d^{2} g n \log \left (c\right )}{e^{3}} + \frac {{\left (e x + d\right )}^{3} b g \log \left (c\right )^{2}}{3 \, e^{3}} - \frac {{\left (e x + d\right )}^{2} b d g \log \left (c\right )^{2}}{e^{3}} + \frac {{\left (e x + d\right )} b d^{2} g \log \left (c\right )^{2}}{e^{3}} - \frac {{\left (e x + d\right )}^{3} b f n}{9 \, e^{3}} + \frac {{\left (e x + d\right )}^{2} b d f n}{2 \, e^{3}} - \frac {{\left (e x + d\right )} b d^{2} f n}{e^{3}} - \frac {{\left (e x + d\right )}^{3} a g n}{9 \, e^{3}} + \frac {{\left (e x + d\right )}^{2} a d g n}{2 \, e^{3}} - \frac {{\left (e x + d\right )} a d^{2} g n}{e^{3}} + \frac {{\left (e x + d\right )}^{3} b f \log \left (c\right )}{3 \, e^{3}} - \frac {{\left (e x + d\right )}^{2} b d f \log \left (c\right )}{e^{3}} + \frac {{\left (e x + d\right )} b d^{2} f \log \left (c\right )}{e^{3}} + \frac {{\left (e x + d\right )}^{3} a g \log \left (c\right )}{3 \, e^{3}} - \frac {{\left (e x + d\right )}^{2} a d g \log \left (c\right )}{e^{3}} + \frac {{\left (e x + d\right )} a d^{2} g \log \left (c\right )}{e^{3}} + \frac {{\left (e x + d\right )}^{3} a f}{3 \, e^{3}} - \frac {{\left (e x + d\right )}^{2} a d f}{e^{3}} + \frac {{\left (e x + d\right )} a d^{2} f}{e^{3}} \]

[In]

integrate(x^2*(a+b*log(c*(e*x+d)^n))*(f+g*log(c*(e*x+d)^n)),x, algorithm="giac")

[Out]

1/3*(e*x + d)^3*b*g*n^2*log(e*x + d)^2/e^3 - (e*x + d)^2*b*d*g*n^2*log(e*x + d)^2/e^3 + (e*x + d)*b*d^2*g*n^2*
log(e*x + d)^2/e^3 - 2/9*(e*x + d)^3*b*g*n^2*log(e*x + d)/e^3 + (e*x + d)^2*b*d*g*n^2*log(e*x + d)/e^3 - 2*(e*
x + d)*b*d^2*g*n^2*log(e*x + d)/e^3 + 2/3*(e*x + d)^3*b*g*n*log(e*x + d)*log(c)/e^3 - 2*(e*x + d)^2*b*d*g*n*lo
g(e*x + d)*log(c)/e^3 + 2*(e*x + d)*b*d^2*g*n*log(e*x + d)*log(c)/e^3 + 2/27*(e*x + d)^3*b*g*n^2/e^3 - 1/2*(e*
x + d)^2*b*d*g*n^2/e^3 + 2*(e*x + d)*b*d^2*g*n^2/e^3 + 1/3*(e*x + d)^3*b*f*n*log(e*x + d)/e^3 - (e*x + d)^2*b*
d*f*n*log(e*x + d)/e^3 + (e*x + d)*b*d^2*f*n*log(e*x + d)/e^3 + 1/3*(e*x + d)^3*a*g*n*log(e*x + d)/e^3 - (e*x
+ d)^2*a*d*g*n*log(e*x + d)/e^3 + (e*x + d)*a*d^2*g*n*log(e*x + d)/e^3 - 2/9*(e*x + d)^3*b*g*n*log(c)/e^3 + (e
*x + d)^2*b*d*g*n*log(c)/e^3 - 2*(e*x + d)*b*d^2*g*n*log(c)/e^3 + 1/3*(e*x + d)^3*b*g*log(c)^2/e^3 - (e*x + d)
^2*b*d*g*log(c)^2/e^3 + (e*x + d)*b*d^2*g*log(c)^2/e^3 - 1/9*(e*x + d)^3*b*f*n/e^3 + 1/2*(e*x + d)^2*b*d*f*n/e
^3 - (e*x + d)*b*d^2*f*n/e^3 - 1/9*(e*x + d)^3*a*g*n/e^3 + 1/2*(e*x + d)^2*a*d*g*n/e^3 - (e*x + d)*a*d^2*g*n/e
^3 + 1/3*(e*x + d)^3*b*f*log(c)/e^3 - (e*x + d)^2*b*d*f*log(c)/e^3 + (e*x + d)*b*d^2*f*log(c)/e^3 + 1/3*(e*x +
 d)^3*a*g*log(c)/e^3 - (e*x + d)^2*a*d*g*log(c)/e^3 + (e*x + d)*a*d^2*g*log(c)/e^3 + 1/3*(e*x + d)^3*a*f/e^3 -
 (e*x + d)^2*a*d*f/e^3 + (e*x + d)*a*d^2*f/e^3

Mupad [B] (verification not implemented)

Time = 1.47 (sec) , antiderivative size = 323, normalized size of antiderivative = 1.25 \[ \int x^2 \left (a+b \log \left (c (d+e x)^n\right )\right ) \left (f+g \log \left (c (d+e x)^n\right )\right ) \, dx=\ln \left (c\,{\left (d+e\,x\right )}^n\right )\,\left (\frac {x^3\,\left (a\,g+b\,f-\frac {2\,b\,g\,n}{3}\right )}{3}+\frac {x^2\,\left (\frac {3\,d\,\left (a\,g+b\,f\right )}{2\,e}-\frac {d\,\left (9\,a\,g+9\,b\,f-6\,b\,g\,n\right )}{6\,e}\right )}{3}-\frac {d\,x\,\left (\frac {9\,d\,\left (a\,g+b\,f\right )}{e}-\frac {d\,\left (9\,a\,g+9\,b\,f-6\,b\,g\,n\right )}{e}\right )}{9\,e}\right )+x^2\,\left (\frac {d\,\left (3\,a\,f-b\,g\,n^2\right )}{6\,e}-\frac {d\,\left (a\,f-\frac {a\,g\,n}{3}-\frac {b\,f\,n}{3}+\frac {2\,b\,g\,n^2}{9}\right )}{2\,e}\right )+{\ln \left (c\,{\left (d+e\,x\right )}^n\right )}^2\,\left (\frac {b\,g\,x^3}{3}+\frac {b\,d^3\,g}{3\,e^3}\right )-x\,\left (\frac {d\,\left (\frac {d\,\left (3\,a\,f-b\,g\,n^2\right )}{3\,e}-\frac {d\,\left (a\,f-\frac {a\,g\,n}{3}-\frac {b\,f\,n}{3}+\frac {2\,b\,g\,n^2}{9}\right )}{e}\right )}{e}-\frac {2\,b\,d^2\,g\,n^2}{3\,e^2}\right )+x^3\,\left (\frac {a\,f}{3}-\frac {a\,g\,n}{9}-\frac {b\,f\,n}{9}+\frac {2\,b\,g\,n^2}{27}\right )+\frac {\ln \left (d+e\,x\right )\,\left (3\,a\,d^3\,g\,n+3\,b\,d^3\,f\,n-11\,b\,d^3\,g\,n^2\right )}{9\,e^3} \]

[In]

int(x^2*(a + b*log(c*(d + e*x)^n))*(f + g*log(c*(d + e*x)^n)),x)

[Out]

log(c*(d + e*x)^n)*((x^3*(a*g + b*f - (2*b*g*n)/3))/3 + (x^2*((3*d*(a*g + b*f))/(2*e) - (d*(9*a*g + 9*b*f - 6*
b*g*n))/(6*e)))/3 - (d*x*((9*d*(a*g + b*f))/e - (d*(9*a*g + 9*b*f - 6*b*g*n))/e))/(9*e)) + x^2*((d*(3*a*f - b*
g*n^2))/(6*e) - (d*(a*f - (a*g*n)/3 - (b*f*n)/3 + (2*b*g*n^2)/9))/(2*e)) + log(c*(d + e*x)^n)^2*((b*g*x^3)/3 +
 (b*d^3*g)/(3*e^3)) - x*((d*((d*(3*a*f - b*g*n^2))/(3*e) - (d*(a*f - (a*g*n)/3 - (b*f*n)/3 + (2*b*g*n^2)/9))/e
))/e - (2*b*d^2*g*n^2)/(3*e^2)) + x^3*((a*f)/3 - (a*g*n)/9 - (b*f*n)/9 + (2*b*g*n^2)/27) + (log(d + e*x)*(3*a*
d^3*g*n + 3*b*d^3*f*n - 11*b*d^3*g*n^2))/(9*e^3)